package com.kmproject.haifu.mvp.model;

import android.app.Application;

import com.google.gson.Gson;
import com.jess.arms.di.scope.ActivityScope;
import com.jess.arms.integration.IRepositoryManager;
import com.jess.arms.mvp.BaseModel;
import com.kmproject.haifu.mvp.contract.PersonalHpStoreContract;
import com.kmproject.haifu.mvp.model.api.service.StoryService;
import com.kmproject.haifu.mvp.model.entity.ResultBean;
import com.kmproject.haifu.mvp.model.entity.beans.MyStoreMainBean;

import javax.inject.Inject;

import io.reactivex.Observable;

/**
 *
 */


@ActivityScope
public class PersonalHpStoreModel extends BaseModel implements PersonalHpStoreContract.Model {
    private Gson mGson;
    private Application mApplication;

    @Inject
    public PersonalHpStoreModel(IRepositoryManager repositoryManager, Gson gson, Application application) {
        super(repositoryManager);
        this.mGson = gson;
        this.mApplication = application;
    }

    @Override
    public void onDestroy() {
        super.onDestroy();
        this.mGson = null;
        this.mApplication = null;
    }

    @Override
    public Observable<ResultBean<MyStoreMainBean>> getStoreInfo(String storeId) {
        return mRepositoryManager.obtainRetrofitService(StoryService.class).getStoreInfo(storeId);
    }
}